<?php

/*
 * Action - Attack - Knight 5$
 *
 * Each other player reveals the top 2 cards of his deck, trashes one of them costing from 3 Coin to 6 Coin, and discards the rest. If a Knight is trashed by this, trash this card.
 * When you trash this, gain a Gold.
 */

class SirVander extends Card implements iAction, iKingdom, iDarkAges, iKnight, iAttack {

    public function __construct() {
        parent::__construct("Sir Vander", 5);
        $this->undoPlay = false;
        $this->undoBuy = false;
    }

    public function getDescription() {
        return array(
            "When you trash this, gain a Gold.",
            "Each other player reveals the top 2 cards of his deck, trashes one of them costing from 3 Coin to 6 Coin, and discards the rest. If a Knight is trashed by this, trash this card.");
    }

    public function trash(Game $game, $name) {
        $gold = $game->moveCardFromPileToPile("Gold", BoardCards, DiscardPile, $name);
        ScreenDisplay::addScreenMessage($game, true, "gain " . nicePrint($gold), "gains " . ScreenDisplay::$LMSG, $name);
        $game->setTempCard($this);
        $game->cardTrashFinished($name);
    }

    public function play(Game $game, $isRealCard) {
        $game->attack($this);

        $knight = new Knights();
        $knight->knightAttack($game, $this);
        $game->cardActionFinished();
    }

}

?>